<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>   
    <title>My JSP 'header.jsp' starting page</title>
	<link href="./css/header.css" rel="stylesheet" type="text/css">   
	<script src="./js/jquery.js" type="text/javascript">
        </script>    
    <script type="text/javascript">
    
    window.onload=function(){
    	   getMessage1();
    	   };
    Date.prototype.format = function(format) 
    { 
      var o = { 
        "M+" : this.getMonth()+1, //month 
        "d+" : this.getDate(),    //day 
        "h+" : this.getHours(),   //hour 
        "m+" : this.getMinutes(), //minute 
        "s+" : this.getSeconds(), //second 
        "q+" : Math.floor((this.getMonth()+3)/3),  //quarter 
        "S" : this.getMilliseconds() //millisecond 
      }; 
      if(/(y+)/.test(format)) format=format.replace(RegExp.$1, 
        (this.getFullYear()+"").substr(4 - RegExp.$1.length)); 
      for(var k in o)if(new RegExp("("+ k +")").test(format)) 
        format = format.replace(RegExp.$1, 
          RegExp.$1.length==1 ? o[k] : 
            ("00"+ o[k]).substr((""+ o[k]).length)); 
      return format; 
    }; 

    function setTime2(){
    	document.getElementById("Time").innerText = new Date().format("yyyy-MM-dd hh:mm:ss");
    }

    window.setInterval(setTime2, 1000);
    /**
    function getMessage1(){ 	
		$.ajax({
            type:"POST",
            url:"./servlet/SystemMessageServlet?type='mes1'",
            timeout: 2000,  
            success:function(data){
           		$("#message1").html(data);  
            }            
         });
    }
    window.setInterval(getMessage1, 60000);
    **/
    function logout(){
    	top.location="./servlet/Logout";
    }
    
    </script>
  </head> 
  <body>
   <div id="header">
            <div class="right">
                <div class="top">
                    <span>|</span>
                    <a href="../common/modifyUser.jsp" target="_blank">修改密码</a>
                    <span>|</span>
                    <a href="javascript:logout()">退出系统</a>
                </div>
                <div class="bottom">
                    <label>
                        当前时间:
                    </label>
                    <span id="Time"></span>
                </div>
            </div>
            <div class="left">
                <div class="text">
                    <label>
                        欢迎登陆，
                    </label>
                    <span id="username">
                     ${user.username} 
                    </span>
                </div>
            </div>
        </div>
  </body>
</html>
